package com.wd.live.view;

import android.content.Intent;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentPagerAdapter;

import com.wd.live.R;
import com.wd.live.base.BaseActivity;
import com.wd.live.base.BaseViewModel;
import com.wd.live.databinding.PersonalDetailsBinding;
import com.wd.live.model.SpUtils;
import com.wd.live.view.activity.MainActivity;

import java.util.ArrayList;

public class PersonalDetails extends BaseActivity<BaseViewModel, PersonalDetailsBinding> {



    @Override
    protected void initData() {
        if(SpUtils.isFirstOpen()){
            ArrayList<Fragment> list = new ArrayList<>();
            list.add(new SexFragment());
            list.add(new ConstellationFragment());
            list.add(new SiginFragment());
            databind.vp.setAdapter(new FragmentPagerAdapter(getSupportFragmentManager()) {
                @NonNull
                @Override
                public Fragment getItem(int position) {
                    return list.get(position);
                }

                @Override
                public int getCount() {
                    return list.size();
                }
            });
        }else{

            startActivity(new Intent(PersonalDetails.this, MainActivity.class));
        }


    }

    @Override
    protected int initLayout() {
        return R.layout.personal_details;
    }

    @Override
    public void onChanged(Object o) {

    }
}